let
  btrfs.mountOptions = [ "compress=zstd" ];
in {
  disko.devices = {
    disk = {
      main = {
        device = "/dev/disk/by-id/ata-KINGSTON_SKC600256G_50026B7785A98ED5";
        type = "disk";
        content = {
          type = "gpt";
          partitions = {
            boot = {
              size = "1M";
              type = "EF02";
              priority = 1;
            };
            ESP = {
              size = "512M";
              type = "EF00";
              content = {
                type = "filesystem";
                format = "vfat";
                mountpoint = "/boot";
              };
            };
            system = {
              size = "100%";
              content = {
                type = "btrfs";
                mountpoint = "/system";
                inherit (btrfs) mountOptions;
                subvolumes = {
                  "/home" = {
                    inherit (btrfs) mountOptions;
                    mountpoint = "/home";
                  };
                  "/nix" = {
                    mountOptions = btrfs.mountOptions ++ [ "noatime" ];
                    mountpoint = "/nix";
                  };
                  "/persist" = {};
                };
              };
            };
          };
        };
      };
      data0 = {
        device = "/dev/disk/by-id/ata-WDC_WD10EFRX-68FYTN0_WD-WCC4J6XD33XN";
        type = "disk";
        content = {
          type = "zfs";
          pool = "datapool";
        };
      };
      cache = {
        device = "/dev/disk/by-id/ata-Samsung_SSD_850_120GB_S3WBNX0KA06012R";
        type = "disk";
        content = {
          type = "gpt";
          partitions = {
            swap = {
              size = "8G";
              content = {
                type = "swap";
                discardPolicy = "both";
              };
            };
            placeholder.size = "12G";
            cache.size = "100%";
          };
        };
      };
    };
    zpool.datapool = {
      type = "zpool";
      mode = "";
      options.autotrim = "on";
      rootFsOptions = {
        canmount = "off";
        compression = "zstd";
        "com.sun:auto-snapshot" = "false";
        mountpoint = "none";
      };
      datasets = {
        data = {
          mountpoint = "/data";
          options.mountpoint = "legacy";
          type = "zfs_fs";
        };
      };
    };
    nodev."/" = {
      fsType = "tmpfs";
      mountOptions = [ "size=256M" "mode=755" ];
    };
  };
}
